extends BattleState
@onready var card_table = $"../../CardTable"
@onready var battle_state_machine = $".."

func _ready():
	Events.card_table_card_switch_select_mode.connect(_on_card_table_card_switch_select_mode)
	Events.card_table_drad_one_card.connect(_on_card_table_drad_one_card)
	Events.card_table_drad_one_card_no_shuffle.connect(_on_card_table_drad_one_card_no_shuffle)

func enter() -> void:
	card_table.show_next_round_button(true)

func exit()  -> void:
	card_table.show_next_round_button(false)
	
func on_next_round_pressed() -> void:
	transition_requested.emit(self, State.STATE_NEXT_ROUND_PRESSED)

func _on_card_table_card_switch_select_mode(card_view: CardView):
	battle_state_machine.release_card_view = card_view
	transition_requested.emit(self, State.STATE_CARD_TABLE_SELECT_MODE)

func _on_card_table_drad_one_card():
	battle_state_machine.draw_card_mode = 1
	transition_requested.emit(self, State.STATE_DRAW_CARD)

	
func _on_card_table_drad_one_card_no_shuffle():
	battle_state_machine.draw_card_mode = 2
	transition_requested.emit(self, State.STATE_DRAW_CARD)
